import Service from "./Service";

/**
 * 接口请求api
 */
const Apis = {

    // ===================== 登录认证api =====================
    userAuthorization: {

        // 用户登录
        userLogin: Service.systemService + "/user/authentication/login",

        // 用户退出
        userQuit: Service.systemService + "/user/authentication/quit",

    },

    // ===================== 权限管理api =====================
    permission: {

        // 分页查询角色
        pageQueryRole: Service.systemService + "/role/page",
        // 新增角色
        addRole: Service.systemService + "/role/add",
        // 修改角色
        editRole: Service.systemService + "/role/edit",
        // 根据id查询角色
        searchRoleById: Service.systemService + "/role/search_by_id",
        // 根据id删除角色
        deleteRoleById: Service.systemService + "/role/remove_by_id",
        // 根据id查询角色拥有的权限列表
        searchPermissionByRoleId: Service.systemService + "/role/search_permissions_by_id",

        // 查询系统所有权限
        searchAllPermission: Service.systemService + "/permission/search",
        // 为角色分配权限
        assignPermission2Role: Service.systemService + "/permission/assign_permissions_to_role",

        // 根据用户id查询用户角色关联关系
        searchRoleRelationByUserId: Service.systemService + "/permission/search_user_role_relation",
        // 根据用户id查询用户权限
        searchUserPermissionByUserId: Service.systemService + "/permission/search_permission_by_userId",
        // 为用户分配角色
        assignRole2User: Service.systemService + "/permission/assign_roles_to_user",
        // 解绑用户和角色
        unbindUserAndRole: Service.systemService + "/permission/unbind_user_role_relation",
        // 刷新缓存角色权限
        refreshCachePermissions: Service.systemService + "/permission/refresh_cache_permission"
    },

    // ===================== 用户管理api =====================
    user: {

        // 分页查询用户
        pageQueryUser: Service.systemService + "/user/page",
        // 根据id查询用户详情
        searchUserById: Service.systemService + "/user/search_by_id",
        // 编辑用户
        editUser: Service.systemService + "/user/edit",
        // 根据id删除用户
        deleteUserById: Service.systemService + "/user/delete",
        // 修改密码
        editPassword: Service.systemService + "/user/authentication/edit_password",

    },

    // ===================== nacos服务治理api =====================
    Nacos: {

        // 查询nacos连接配置列表
        searchNacosConfigList: Service.governanceService + "/search_list",
        // 新增nacos配置
        addNacosConfig: Service.governanceService + "/add_config",
        // 编辑nacos配置
        editNacosConfig: Service.governanceService + "/edit_config",
        // 根据id删除nacos配置
        deleteNacosConfigById: Service.governanceService + "/delete_by_id",

        // 同步yaml到数据库
        syncYamlToDatabase: Service.governanceService + "/sync_yaml_to_database",
        // 分页查询yaml配置
        pageQueryYamlConfig: Service.governanceService + "/page_yaml",
        // 根据id查询yaml配置详情
        searchYamlConfigById: Service.governanceService + "/search_yaml_by_data_id",

        // 查询在线的服务实例
        pageQueryServiceInstance: Service.governanceService + "/page_service_instance",

    },

    // ===================== 数据库管理api =====================
    database: {

        // 查询数据库连接列表
        pageQueryDatabase: Service.databaseService + "/page",
        // 新增数据库连接
        addSysDatabase: Service.databaseService + "/add",
        // 编辑数据库连接
        editSysDatabase: Service.databaseService + "/edit",


    }

}
export default Apis;